Next, we will look at Cloud Functions. With Cloud Functions,
you can develop an application that is event-driven, serverless,
and highly scalable. Each function is a lightweight
microservice that enables you to integrate application
components and data sources. Cloud Functions is ideal for microservices
that require a small piece of code to quickly process data
in response to an event. Cloud Functions is priced
according to how long your function runs, the number of times it is invoked,
and the resources that you provision for the function. In this example,
all components of the application use fully managed services:
Cloud Storage, Pub/Sub, Cloud Functions, the Vision API,
and the Cloud Translation API. These services scale
automatically depending on the volume of incoming data
and required compute capacity. This scalability and reliability enables
you to focus on your application code. Cloud Functions is appropriate
for many use cases. You can use Cloud Functions
for lightweight extract-transform-load, or ETL, operations or for processing messages that are published to a Pub/Sub topic. Cloud Functions can also serve
as a target for webhooks, which allow applications or services
to make direct HTTP calls to invoke microservices
that are implemented with Cloud Functions. Any lightweight functionality
that is run in response to an event is a candidate for Cloud Functions. Cloud Functions lets you focus on code. Let's look at Node.js as an example. When you use the Node.js runtime,
your function's source code must be exported in a Node.js module. You do not need to upload zip files
with package dependencies. You can specify any dependencies
for your Node.js Cloud Function in a package.json file. The Cloud Functions service automatically installs all dependencies
before running your code. You can use Cloud Client Libraries
to programmatically interact with other Google Cloud
services. Cloud Functions currently supports Node.js, Python, Go, Java, .NET, Ruby, and PHP.